package test41;

import java.io.*;

/**
 * Created with IntelliJ IDEA.
 * Description:
 * User: ws
 * Date: 2023-05-13
 * Time: 15:23
 */
//https://www.nowcoder.com/questionTerminal/a811535fed784ea492b63622c28c75c5
public class Main {
    static BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
    static BufferedWriter bw = new BufferedWriter(new OutputStreamWriter(System.out));

    public static void main(String[] args) throws IOException {
        String str = null;
        while ((str = br.readLine()) != null) {
            String[] chessBoard = new String[20];
            chessBoard[0] = str;
            for (int i = 1; i < 20; i++) {
                chessBoard[i] = br.readLine();
            }
            //其中黑子用“*”表示，白子用“+”表示，空白位置用“.”表示。
            boolean flag = false;
            for (int i = 0; i < 20; i++) {
                for (int j = 0; j < 20; j++) {
                    char a = chessBoard[i].charAt(j);
                    if (a == '*' || a == '+') {
                        flag = judge(chessBoard, i, j, a);
                        if (flag) {
                            break;
                        }
                    }
                }
                if (flag) {
                    break;
                }
            }
            if (flag) {
                bw.write("Yes\n");
            } else {
                bw.write("No\n");
            }
        }
        bw.flush();
        bw.close();
        br.close();
    }

    public static boolean judge(String[] chessBoard, int row, int col, char c) {
        //上下
        int num = upDown(chessBoard, row, col, c);
        if (num > 4) {
            return true;
        }
        //左右
        num = leftRight(chessBoard, row, col, c);
        if (num > 4) {
            return true;
        }
        // \
        num = backslash(chessBoard, row, col, c);
        if (num > 4) {
            return true;
        }
        // /
        num = slash(chessBoard, row, col, c);
        if (num > 4) {
            return true;
        }
        return false;
    }


    public static int upDown(String[] chessBoard, int row, int col, char c) {
        int count = 0;
        // up
        int x = row - 1;
        while (x >= 0) {
            if (c != chessBoard[x].charAt(col)) {
                break;
            }
            count++;
            x--;
        }
        // down
        x = row + 1;
        while (x < 20) {
            if (c != chessBoard[x].charAt(col)) {
                break;
            }
            count++;
            x++;
        }
        return count + 1;
    }

    public static int leftRight(String[] chessBoard, int row, int col, char c) {
        int count = 0;
        // left
        int y = col - 1;
        while (y >= 0) {
            if (c != chessBoard[row].charAt(y)) {
                break;
            }
            count++;
            y--;
        }
        // right
        y = col + 1;
        while (y < 20) {
            if (c != chessBoard[row].charAt(y)) {
                break;
            }
            count++;
            y++;
        }
        return count + 1;
    }

    public static int backslash(String[] chessBoard, int row, int col, char c) {
        int count = 0;
        // \上
        int x = row - 1;
        int y = col - 1;
        while (x >= 0 && y >= 0) {
            if (c != chessBoard[x].charAt(y)) {
                break;
            }
            count++;
            x--;
            y--;
        }
        // \下
        x = row + 1;
        y = col + 1;
        while (x < 20 && y < 20) {
            if (c != chessBoard[x].charAt(y)) {
                break;
            }
            count++;
            x++;
            y++;
        }
        return count + 1;
    }

    public static int slash(String[] chessBoard, int row, int col, char c) {
        int count = 0;
        //  /上
        int x = row - 1;
        int y = col + 1;
        while (x >= 0 && y < 20) {
            if (c != chessBoard[x].charAt(y)) {
                break;
            }
            count++;
            x--;
            y++;
        }
        // /下
        x = row + 1;
        y = col - 1;
        while (x < 20 && y >= 0) {
            if (c != chessBoard[x].charAt(y)) {
                break;
            }
            count++;
            x++;
            y--;
        }
        return count + 1;
    }
}
